package work20241203_chap6oop.m_demo10;

/**
 * @author zdl
 * @date 2024/12/5
 */
//储蓄账户
public class SavingAccount extends Account{
    private double interestRate;

    public SavingAccount() {
    }

    public SavingAccount(long id, double balance, String password) {
        super(id, balance, password);
    }

    public SavingAccount(double interestRate) {
        this.interestRate = interestRate;
    }

    public SavingAccount(long id, double balance, String password, double interestRate) {
        super(id, balance, password);
        this.interestRate = interestRate;
    }

    public double getInterestRate() {
        return interestRate;
    }

    public void setInterestRate(double interestRate) {
        if(interestRate > 0 && interestRate < 0.1){
            this.interestRate = interestRate;
        }else {
            System.out.println("利率为0-0.1");
        }

    }
}
